package com.huashi.dealer.modular.business.user.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * Store端用户详情VO
 *
 * @author 谭陈强
 * @since 2025-08-07
 */
@Data
@Schema(description = "Store端用户详情VO")
public class StoreUserDetailVo {

    /**
     * 用户ID
     */
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 账号
     */
    @Schema(description = "账号")
    private String account;

    /**
     * 昵称
     */
    @Schema(description = "昵称")
    private String nickName;

    /**
     * 真实姓名
     */
    @Schema(description = "真实姓名")
    private String realName;

    /**
     * 手机号
     */
    @Schema(description = "手机号")
    private String mobile;

    /**
     * 上级业务员信息
     */
    @Schema(description = "上级业务员信息")
    private StoreUserVo storeUser;

    /**
     * 地域信息
     */
    @Schema(description = "地域信息")
    private RegionVo region;

    /**
     * 本年目标金额
     */
    @Schema(description = "本年目标金额")
    private BigDecimal salesMoney;

    /**
     * 不可查看商品列表
     */
    @Schema(description = "不可查看商品列表")
    private List<GoodsVo> goodsList;

    /**
     * 基本账户余额
     */
    @Schema(description = "基本账户余额")
    private BigDecimal balance;

    /**
     * 返利账户余额
     */
    @Schema(description = "返利账户余额")
    private BigDecimal rebate;

    /**
     * 核销账户余额
     */
    @Schema(description = "核销账户余额")
    private BigDecimal writeoff;

    /**
     * 注册时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "注册时间")
    private LocalDateTime createTime;

    /**
     * 业务员VO
     */
    @Data
    @Schema(description = "业务员VO")
    public static class StoreUserVo {
        /**
         * 业务员ID
         */
        @Schema(description = "业务员ID")
        private Long storeUserId;

        /**
         * 业务员姓名
         */
        @Schema(description = "业务员姓名")
        private String realName;

        /**
         * 业务员手机号
         */
        @Schema(description = "业务员手机号")
        private String mobile;
    }

    /**
     * 地域VO
     */
    @Data
    @Schema(description = "地域VO")
    public static class RegionVo {
        /**
         * 省份ID
         */
        @Schema(description = "省份ID")
        private Integer provinceId;

        /**
         * 省份名称
         */
        @Schema(description = "省份名称")
        private String province;

        /**
         * 城市ID
         */
        @Schema(description = "城市ID")
        private Integer cityId;

        /**
         * 城市名称
         */
        @Schema(description = "城市名称")
        private String city;

        /**
         * 区县ID
         */
        @Schema(description = "区县ID")
        private Integer regionId;

        /**
         * 区县名称
         */
        @Schema(description = "区县名称")
        private String region;
    }

    /**
     * 商品VO
     */
    @Data
    @Schema(description = "商品VO")
    public static class GoodsVo {
        /**
         * 商品ID
         */
        @Schema(description = "商品ID")
        private Long goodsId;

        /**
         * 商品名称
         */
        @Schema(description = "商品名称")
        private String goodsName;

        /**
         * 商品图片
         */
        @Schema(description = "商品图片")
        private List<String> imagePath;
    }
}
